﻿using System;
using Hjt212Parser;
using System.ServiceProcess;
using Biz.Process;

namespace Biz
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        static void Main()
        {
            var isNotDebug = true;
            if (isNotDebug)
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new BizProcessor()
                };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                string msg =
                     "##0467QN=20190507081009170;ST=32;CN=2051;PW=123456;MN=83028583206118;Flag=5;CP=&&DataTime=20190507080000;w01018-Min=81.300,w01018-Max=82.000,w01018-Avg=81.287,w01018-Cou=0.013,w01018-Flag=N;w21003-Min=17.819,w21003-Max=17.819,w21003-Avg=17.789,w21003-Cou=0.003,w21003-Flag=N;w01001-Min=7.972,w01001-Max=7.979,w01001-Avg=7.975,w01001-Cou=0.000,w01001-Flag=N;w00000-ST=0.000,w00000-End=0.000,w00000-Min=0.267,w00000-Max=0.267,w00000-Avg=0.267,w00000-Cou=0.160,w00000-Flag=N&&7D00";
                //Processor2051.ProcessToCommonTable(msg);
                var rtd = Parser.GetDoubleByKey("w01018-Cou", msg);
             var b=   Math.Abs(rtd.Value - 0.014) >= 0.0001;
             Console.WriteLine(b);
             Console.ReadLine();
            }

            //test
            //new TinzDataGateway().Main();
            //Thread.Sleep(1000 * 60 * 60);
        }
    }
}
